package kr.co.dayve.site.management.dao;

import kr.co.dayve.site.domain.Category;
import kr.co.dayve.site.domain.Item;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import java.util.List;


public class ItemDaoImpl extends SqlMapClientDaoSupport implements ItemDao {

    public List getItemList(){
        return getSqlMapClientTemplate().queryForList("ITEM.getItemList");
    }

    public List getItemListByCategory(Category category){
        return getSqlMapClientTemplate().queryForList("ITEM.getItemListByCategory", category);
    }

    public String getTotalItemCountByCategory(Category category){
        return (String)getSqlMapClientTemplate().queryForObject("ITEM.getTotalItemCountByCategory", category);
    }

    public Item getItemByItemId(String item_id){
        return (Item)getSqlMapClientTemplate().queryForObject("ITEM.getItemByItemId", item_id);
    }

    public String getTotalItemByMembersId(String members_id){
        return (String)getSqlMapClientTemplate().queryForObject("ITEM.getTotalItemByMembersId", members_id);
    }
}
